package com.css.dzj.zfjg.modules.detail.service;

import com.css.dzj.zfjg.modules.clue.entity.Clue;
import com.css.dzj.zfjg.modules.creditassess.entity.JgLhjgCreditAssessEntity;
import com.css.dzj.zfjg.modules.detail.entity.Detail;
import com.css.dzj.zfjg.modules.detail.vo.Infopush;
import com.css.dzj.zfjg.common.util.page.PageBean;
import com.querydsl.core.QueryResults;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 信用详情service
 * @author liyuan
 */
public interface DetailService {
    void add(Detail detail);

    void update(Detail detail);

    Detail findById(String id);

    /**
     * 分页多条件查询
     * @param enterpriseName 企业名称
     * @param enterpriseClassification 企业分类
     * @param enterpriseScoreBegin 企业分数开始
     * @param enterpriseScoreEnd 企业分数结束
     * @param status 信用评估状态
     * @param pageable
     * @return
     */
    QueryResults<Detail> getPage(String enterpriseName, String enterpriseClassification, String enterpriseScoreBegin,
                                 String enterpriseScoreEnd, String status, Pageable pageable);

    void addDetailFromExcel(MultipartFile file) throws Exception;
    void exportDetailToExcel(HttpServletResponse response, List<Detail> details);
    /**
     * 字符串数组转化为实体
     * @param s
     * @return
     */
    Detail castDetail(String[] s);
    Boolean isRepeatByEnterpriseIdNumber(String enterpriseIdNumber);
    /**
     * 通过企业证件号码查询企业信用详情
     * @param enterpriseIdNumber
     * @return
     */
    Detail queryByIdNumber(String enterpriseIdNumber);
    List<Detail> queryByIds(String ids);

    PageBean<Infopush> groupBy(Pageable pageable);

    /**
     * 根据参数导出数据到Excel
     */
    List<Detail> queryByParams(String enterpriseName, String enterpriseClassification, String enterpriseScoreBegin, String enterpriseScoreEnd, String status);

    /**
     * 企业信用信用线索反馈
     * @param detail
     * @param clue
     */
    void feedback(Detail detail, Clue clue);
    /**
     * 根据参数导出数据到Excel
     * @param enterpriseName
     * @param  enterpriseScoreBegin
     * @param  enterpriseScoreEnd
     * @param  enterpriseClassification
     */
    List<Detail> queryByParams(String enterpriseName, String enterpriseScoreBegin,String enterpriseScoreEnd , String enterpriseClassification);
}
